﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    xmlns:System="clr-namespace:System;assembly=mscorlib"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
                    xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
                    xmlns:vsm="clr-namespace:System.Windows;assembly=PresentationFramework"
                    mc:Ignorable="d">

    <!-- Global Settings-->
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Brushes.xaml" />
        <ResourceDictionary Source="Fonts.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!--Control Label Style-->
    <Style x:Key="ControlLabelStyle"
           TargetType="TextBlock">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="Foreground"
                Value="{StaticResource LabelTextBrush}" />
        <Setter Property="FontFamily"
                Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize"
                Value="{StaticResource LabelFontSize}" />
        <Setter Property="TextOptions.TextHintingMode"
                Value="Animated" />
    </Style>

    <!--ValidationToolTipTemplate Style-->
    <ControlTemplate x:Key="ValidationToolTipTemplate">
        <Grid x:Name="Root"
              Margin="5,0"
              Opacity="0"
              RenderTransformOrigin="0,0">
            <Grid.RenderTransform>
                <TranslateTransform x:Name="xform"
                                    X="-25" />
            </Grid.RenderTransform>
            <vsm:VisualStateManager.VisualStateGroups>
                <vsm:VisualStateGroup x:Name="OpenStates">
                    <vsm:VisualStateGroup.Transitions>
                        <vsm:VisualTransition GeneratedDuration="0" />
                        <vsm:VisualTransition GeneratedDuration="0:0:0.2"
                                              To="Open">
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="X"
                                                               Storyboard.TargetName="xform">
                                    <SplineDoubleKeyFrame KeyTime="0:0:0.2"
                                                          Value="0" />
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                               Storyboard.TargetName="Root">
                                    <SplineDoubleKeyFrame KeyTime="0:0:0.2"
                                                          Value="1" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </vsm:VisualTransition>
                    </vsm:VisualStateGroup.Transitions>
                    <vsm:VisualState x:Name="Closed">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                           Storyboard.TargetName="Root">
                                <SplineDoubleKeyFrame KeyTime="0"
                                                      Value="0" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </vsm:VisualState>
                    <vsm:VisualState x:Name="Open">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="X"
                                                           Storyboard.TargetName="xform">
                                <SplineDoubleKeyFrame KeyTime="0"
                                                      Value="0" />
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                           Storyboard.TargetName="Root">
                                <SplineDoubleKeyFrame KeyTime="0"
                                                      Value="1" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </vsm:VisualState>
                </vsm:VisualStateGroup>
            </vsm:VisualStateManager.VisualStateGroups>
            <Border Background="{StaticResource ValidationBrush1}"
                    CornerRadius="5"
                    Margin="4,4,-4,-4" />
            <Border Background="{StaticResource ValidationBrush2}"
                    CornerRadius="4"
                    Margin="3,3,-3,-3" />
            <Border Background="{StaticResource ValidationBrush3}"
                    CornerRadius="3"
                    Margin="2,2,-2,-2" />
            <Border Background="{StaticResource ValidationBrush4}"
                    CornerRadius="2"
                    Margin="1,1,-1,-1" />
            <Border Background="{StaticResource ValidationBrush5}"
                    CornerRadius="2" />
            <Border CornerRadius="2">
                <TextBlock Foreground="{StaticResource WhiteColorBrush}"
                           FontWeight="SemiBold"
                           MaxWidth="250"
                           Margin="8,4,8,4"
                           TextWrapping="Wrap"
                           Text="{Binding (Validation.Errors)[0].ErrorContent}"
                           UseLayoutRounding="false" />
            </Border>
        </Grid>
    </ControlTemplate>

    <!--CommonValidationToolTipTemplate Style-->
    <ControlTemplate x:Key="CommonValidationToolTipTemplate"
                     TargetType="ToolTip">
        <Grid x:Name="Root"
              Margin="5,0"
              Opacity="0"
              RenderTransformOrigin="0,0">
            <vsm:VisualStateManager.VisualStateGroups>
                <vsm:VisualStateGroup x:Name="OpenStates">
                    <vsm:VisualStateGroup.Transitions>
                        <vsm:VisualTransition GeneratedDuration="0" />
                        <vsm:VisualTransition GeneratedDuration="0:0:0.2"
                                              To="Open">
                            <Storyboard>
                                <DoubleAnimation Duration="0:0:0.2"
                                                 Storyboard.TargetName="Translation"
                                                 Storyboard.TargetProperty="X"
                                                 To="0">
                                    <DoubleAnimation.EasingFunction>
                                        <BackEase Amplitude=".3"
                                                  EasingMode="EaseOut" />
                                    </DoubleAnimation.EasingFunction>
                                </DoubleAnimation>
                                <DoubleAnimation Duration="0:0:0.2"
                                                 Storyboard.TargetName="Root"
                                                 Storyboard.TargetProperty="Opacity"
                                                 To="1" />
                            </Storyboard>
                        </vsm:VisualTransition>
                    </vsm:VisualStateGroup.Transitions>
                    <vsm:VisualState x:Name="Closed">
                        <Storyboard>
                            <DoubleAnimation Duration="0"
                                             Storyboard.TargetName="Root"
                                             Storyboard.TargetProperty="Opacity"
                                             To="0" />
                        </Storyboard>
                    </vsm:VisualState>
                    <vsm:VisualState x:Name="Open">
                        <Storyboard>
                            <DoubleAnimation Duration="0"
                                             Storyboard.TargetName="Translation"
                                             Storyboard.TargetProperty="X"
                                             To="0" />
                            <DoubleAnimation Duration="0"
                                             Storyboard.TargetName="Root"
                                             Storyboard.TargetProperty="Opacity"
                                             To="1" />
                        </Storyboard>
                    </vsm:VisualState>
                </vsm:VisualStateGroup>
            </vsm:VisualStateManager.VisualStateGroups>
            <Grid.RenderTransform>
                <TranslateTransform x:Name="Translation"
                                    X="-25" />
            </Grid.RenderTransform>
            <Border Margin="4,4,-4,-4"
                    Background="{StaticResource ValidationBrush1}"
                    CornerRadius="5" />
            <Border Margin="3,3,-3,-3"
                    Background="{StaticResource ValidationBrush2}"
                    CornerRadius="4" />
            <Border Margin="2,2,-2,-2"
                    Background="{StaticResource ValidationBrush3}"
                    CornerRadius="3" />
            <Border Margin="1,1,-1,-1"
                    Background="{StaticResource ValidationBrush4}"
                    CornerRadius="2" />
            <Border Background="{StaticResource ValidationBrush5}"
                    CornerRadius="2">
                <TextBlock Margin="8,4,8,4"
                           MaxWidth="250"
                           UseLayoutRounding="false"
                           Foreground="{StaticResource WhiteColorBrush}"
                           Text="{Binding (Validation.Errors)[0].Exception.Message}"
                           TextWrapping="Wrap" />
            </Border>
        </Grid>
    </ControlTemplate>

    <!--SearchButtonStyle-->
    <Style x:Key="SearchButtonStyle"
           TargetType="Button">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="Margin"
                Value="-22,0,20,0" />
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid Width="14"
                          Height="16"
                          HorizontalAlignment="Center"
                          VerticalAlignment="Center"
                          Margin="-3,-3,0,0">
                        <Rectangle Fill="#FF767676"
                                   HorizontalAlignment="Right"
                                   Height="8"
                                   Margin="0,0,-0.164,-0.334"
                                   RadiusY="0.5"
                                   RadiusX="0.5"
                                   RenderTransformOrigin="0.5,0.5"
                                   Stroke="#FF767676"
                                   UseLayoutRounding="False"
                                   VerticalAlignment="Bottom"
                                   Width="4">
                            <Rectangle.RenderTransform>
                                <RotateTransform Angle="-45" />
                            </Rectangle.RenderTransform>
                        </Rectangle>
                        <Ellipse Fill="Transparent"
                                 Margin="0,0,1,3"
                                 Stroke="#FF767676" />
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Border x:Name="BorderSelected"
                            Margin="-6,0,0,0"
                            BorderThickness="1"
                            BorderBrush="{DynamicResource TextBoxBorderBrush}"
                            CornerRadius="2">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                        To="{StaticResource HighlightLightColor}"
                                                        Storyboard.TargetProperty="(SolidColorBrush.Color)"
                                                        Storyboard.TargetName="ContentPresenterWrapperColor"
                                                        d:IsOptimized="True" />
                                        <ColorAnimation Duration="0"
                                                        To="{StaticResource Gray5}"
                                                        Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
                                                        Storyboard.TargetName="grid"
                                                        d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                        To="{StaticResource Gray5}"
                                                        Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
                                                        Storyboard.TargetName="grid"
                                                        d:IsOptimized="True" />
                                        <DoubleAnimation Duration="0"
                                                         To="0.8"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         Storyboard.TargetName="grid"
                                                         d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="DisabledOverlay">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="grid"
                              Cursor="{TemplateBinding Cursor}">
                            <Grid.Background>
                                <SolidColorBrush Color="{StaticResource BaseColor2}" />
                            </Grid.Background>
                            <TextBlock x:Name="UnderlineTextBlock"
                                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                       Margin="{TemplateBinding Padding}"
                                       Text="{TemplateBinding Content}"
                                       TextDecorations="Underline"
                                       Visibility="Collapsed"
                                       VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                				<TextBlock.Foreground>
                					<SolidColorBrush Color="{StaticResource HighlightDarkColor}" />
                				</TextBlock.Foreground>
                            </TextBlock>
                            <TextBlock x:Name="DisabledOverlay"
                                       Foreground="{StaticResource DisabledForegroundBrush}"
                                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                       Margin="{TemplateBinding Padding}"
                                       Text="{TemplateBinding Content}"
                                       Visibility="Collapsed"
                                       VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                       Panel.ZIndex="1" />
                            <ContentControl>
                                <ContentControl.Foreground>
                                    <SolidColorBrush x:Name="ContentPresenterWrapperColor"
                                                     Color="{StaticResource HighlightDarkColor}" />
                                </ContentControl.Foreground>
                                <ContentPresenter x:Name="contentPresenter"
                                                  ContentTemplate="{TemplateBinding ContentTemplate}"
                                                  Content="{TemplateBinding Content}"
                                                  Width="21"
                                                  Margin="2,3,0,0" />
                            </ContentControl>
                            <Rectangle x:Name="FocusVisualElement"
                                       IsHitTestVisible="false"
                                       Opacity="0"
                                       StrokeThickness="1">
                                <Rectangle.Stroke>
                                    <SolidColorBrush Color="{StaticResource HighlightLightColor}" />
                                </Rectangle.Stroke>
                            </Rectangle>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Button Style-->
    <Style TargetType="Button"
           x:Key="DefaultButtonStyle">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="Background"
                Value="{StaticResource GrayBrush7}" />
        <Setter Property="BorderBrush"
                Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Foreground"
                Value="{StaticResource TextBrush}" />
        <Setter Property="FontFamily"
                Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize"
                Value="{StaticResource ContentFontSize}" />
        <Setter Property="FontWeight"
                Value="Bold" />
        <Setter Property="Padding"
                Value="5,6" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="IsTabStop"
                Value="False" />
        <Setter Property="Focusable"
                Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="MouseOverBorder">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="PressedBorder">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="DisabledVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value="0.7" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="contentPresenter">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="0.3" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="FocusRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="FocusInnerRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>

                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unfocused" />
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="3" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{StaticResource ControlsDisabledBrush}"
                                   IsHitTestVisible="false"
                                   Opacity="0"
                                   RadiusY="3"
                                   RadiusX="3" />
                        <Border x:Name="MouseOverBorder"
                                Background="{StaticResource GrayBrush8}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Border x:Name="PressedBorder"
                                Background="{StaticResource GrayBrush5}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Rectangle x:Name="FocusRectangle"
                                   Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}"
                                   RadiusY="4"
                                   RadiusX="4"
                                   Margin="-1"
                                   Opacity="0" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   StrokeThickness="{TemplateBinding BorderThickness}"
                                   Stroke="{StaticResource TextBoxMouseOverBorderBrush}"
                                   RadiusX="3"
                                   RadiusY="3"
                                   Opacity="0" />
                        <ContentPresenter x:Name="contentPresenter"
                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                          Content="{TemplateBinding Content}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          Margin="{TemplateBinding Padding}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          RenderOptions.ClearTypeHint="Enabled" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--HyperlinkButton Style-->
    <Style TargetType="Button"
           x:Key="DefaultHyperlinkButtonStyle">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="Foreground"
                Value="{StaticResource HighlightBrush}" />
        <Setter Property="FontFamily"
                Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize"
                Value="{StaticResource HyperlinkFontSize}" />
        <Setter Property="Padding"
                Value="2,0,2,0" />
        <Setter Property="Cursor"
                Value="Hand" />
        <Setter Property="HorizontalContentAlignment"
                Value="Left" />
        <Setter Property="VerticalContentAlignment"
                Value="Top" />
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="IsTabStop"
                Value="False" />
        <Setter Property="Focusable"
                Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid Background="{TemplateBinding Background}"
                          Cursor="{TemplateBinding Cursor}">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="UnderlineTextBlock">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenterWrapperColor"
                                                                      Storyboard.TargetProperty="Color">
                                            <EasingColorKeyFrame KeyTime="0"
                                                                 Value="{StaticResource AccentColorLightBlue}" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="UnderlineTextBlock">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="DisabledOverlay">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="contentPresenter">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>

                        <TextBlock x:Name="UnderlineTextBlock"
                                   HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                   VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                   Margin="{TemplateBinding Padding}"
                                   Text="{TemplateBinding Content}"
                                   TextDecorations="Underline"
                                   Visibility="Collapsed"
                                   FontSize="{TemplateBinding FontSize}">
                            <TextBlock.Foreground>
                                <SolidColorBrush Color="{StaticResource AccentColorBlue}"
                                                 PresentationOptions:Freeze="True" />
                            </TextBlock.Foreground>
                        </TextBlock>
                        <TextBlock x:Name="DisabledOverlay"
                                   Foreground="{StaticResource DisabledForegroundBrush}"
                                   HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                   VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                   Margin="{TemplateBinding Padding}"
                                   Text="{TemplateBinding Content}"
                                   Visibility="Collapsed"
                                   FontSize="{TemplateBinding FontSize}" />

                        <ContentControl FontSize="{TemplateBinding FontSize}"
                                        IsTabStop="{TemplateBinding IsTabStop}">
                            <ContentControl.Foreground>
                                <SolidColorBrush x:Name="ContentPresenterWrapperColor"
                                                 Color="{StaticResource AccentColorBlue}"
                                                 PresentationOptions:Freeze="True" />
                            </ContentControl.Foreground>
                            <TextBlock x:Name="contentPresenter"
                                       Text="{TemplateBinding Content}"
                                       HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                       VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                       Margin="{TemplateBinding Padding}"
                                       FontSize="{TemplateBinding FontSize}" />
                        </ContentControl>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--TextBox Style-->
    <Style TargetType="TextBox"
           x:Key="DefaultTextBoxStyle">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="FontFamily"
                Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize"
                Value="{StaticResource ContentFontSize}" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="FocusVisualStyle"
                Value="{x:Null}" />
        <Setter Property="MinHeight"
                Value="26" />
        <Setter Property="Background"
                Value="{StaticResource ControlBackgroundBrush}" />
        <Setter Property="Foreground"
                Value="{StaticResource TextBrush}" />
        <Setter Property="Padding"
                Value="0" />
        <Setter Property="BorderBrush"
                Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <Grid x:Name="RootElement">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         Storyboard.TargetName="FocusRectangle" />
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="DisabledVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="ReadOnly">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="ReadOnlyVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         Storyboard.TargetName="FocusRectangle" />
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         Storyboard.TargetName="FocusInnerRectangle" />
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unfocused">
                                    <Storyboard />
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="ValidationStates">
                                <vsm:VisualState x:Name="Valid" />
                                <vsm:VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen"
                                                                       Storyboard.TargetName="validationTooltip">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Boolean>True</sys:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="Base"
                                   Stroke="{TemplateBinding BorderBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}"
                                   Opacity="1"
                                   Fill="{StaticResource ControlBackgroundBrush}" />
                        <Rectangle x:Name="FocusRectangle"
                                   StrokeThickness="{TemplateBinding BorderThickness}"
                                   Opacity="0"
                                   Stroke="{StaticResource TextBoxMouseOverBorderBrush}" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   StrokeThickness="{TemplateBinding BorderThickness}"
                                   Opacity="0"
                                   Margin="1"
                                   Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}" />
                        <Grid Margin="0,1,0,0">
                            <Border x:Name="ReadOnlyVisualElement"
                                    Background="{StaticResource ReadOnlyBrush}"
                                    Opacity="0" />
                            <Grid>
                                <ScrollViewer x:Name="PART_ContentHost"
                                              BorderThickness="0"
                                              IsTabStop="False"
                                              Margin="4,0,4,2"
                                              VerticalAlignment="Center"
                                              Background="{x:Null}" />
                            </Grid>
                        </Grid>
                        <Rectangle x:Name="DisabledVisualElement"
                                   Stroke="{StaticResource ControlsDisabledBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}"
                                   Fill="{StaticResource ControlsDisabledBrush}"
                                   IsHitTestVisible="False"
                                   Opacity="0" />
                        <Border x:Name="ValidationErrorElement"
                                BorderBrush="{StaticResource ControlsValidationBrush}"
                                BorderThickness="1"
                                Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip"
                                         IsHitTestVisible="True"
                                         DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Placement="Right"
                                         PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Template="{StaticResource ValidationToolTipTemplate}" />
                            </ToolTipService.ToolTip>
                            <Grid Background="Transparent"
                                  HorizontalAlignment="Right"
                                  Height="12"
                                  Margin="1,-4,-4,0"
                                  VerticalAlignment="Top"
                                  Width="12">
                                <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"
                                      Fill="{StaticResource ValidationBrush5}"
                                      Margin="1,3,0,0" />
                                <Path Data="M 0,0 L2,0 L 8,6 L8,8"
                                      Fill="{StaticResource WhiteColorBrush}"
                                      Margin="1,3,0,0" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--ComboBox Style-->
    <Style x:Key="ComboBoxFocusVisualStyle">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid>
                        <Rectangle x:Name="FocusRectangle"
                                   RadiusY="3"
                                   RadiusX="3"
                                   Stroke="{StaticResource HighlightBrush}"
                                   StrokeThickness="1" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   Margin="1"
                                   RadiusY="3"
                                   RadiusX="3"
                                   Stroke="{StaticResource HighlightLightBrush}"
                                   StrokeThickness="1" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ComboBoxReadonlyToggleButton"
           TargetType="{x:Type ToggleButton}">
        <Setter Property="OverridesDefaultStyle"
                Value="True" />
        <Setter Property="IsTabStop"
                Value="False" />
        <Setter Property="Focusable"
                Value="True" />
        <Setter Property="ClickMode"
                Value="Press" />
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="BorderBrush"
                Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Grid>
                        <Border x:Name="Chrome"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="3"
                                SnapsToDevicePixels="true">
                            <Grid HorizontalAlignment="Right"
                                  Margin="2,0"
                                  Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
                                <Path x:Name="Arrow"
                                      Data="M 0 0 L 3.5 4 L 7 0 Z"
                                      Fill="Black"
                                      HorizontalAlignment="Center"
                                      Margin="3,1,0,0"
                                      VerticalAlignment="Center" />
                            </Grid>
                        </Border>
                        <Rectangle x:Name="FocusRectangle"
                                   RadiusY="3"
                                   RadiusX="3"
                                   Stroke="{StaticResource HighlightBrush}"
                                   StrokeThickness="1"
                                   Visibility="Collapsed" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   Margin="1"
                                   RadiusY="3"
                                   RadiusX="3"
                                   Stroke="{StaticResource HighlightLightBrush}"
                                   StrokeThickness="1"
                                   Visibility="Collapsed" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked"
                                 Value="true">
                            <Setter Property="Visibility"
                                    TargetName="FocusRectangle"
                                    Value="Visible" />
                            <Setter Property="Visibility"
                                    TargetName="FocusInnerRectangle"
                                    Value="Visible" />
                        </Trigger>
                        <Trigger Property="IsMouseOver"
                                 Value="True">
                            <Setter Property="Background"
                                    TargetName="Chrome"
                                    Value="{StaticResource GrayBrush8}" />
                        </Trigger>
                        <Trigger Property="IsEnabled"
                                 Value="False">
                            <Setter Property="Fill"
                                    TargetName="Arrow"
                                    Value="{StaticResource GrayBrush11}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ComboBoxEditableTextBox"
           TargetType="{x:Type TextBox}"
           BasedOn="{StaticResource {x:Type TextBox}}">
        <Setter Property="OverridesDefaultStyle"
                Value="True" />
        <Setter Property="AllowDrop"
                Value="true" />
        <Setter Property="MinWidth"
                Value="0" />
        <Setter Property="MinHeight"
                Value="0" />
        <Setter Property="BorderThickness"
                Value="0" />
        <Setter Property="FocusVisualStyle"
                Value="{x:Null}" />
        <Setter Property="ScrollViewer.PanningMode"
                Value="VerticalFirst" />
        <Setter Property="Stylus.IsFlicksEnabled"
                Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <ScrollViewer x:Name="PART_ContentHost"
                                  Background="Transparent"
                                  BorderThickness="{TemplateBinding BorderThickness}"
                                  Focusable="false"
                                  HorizontalScrollBarVisibility="Hidden"
                                  VerticalScrollBarVisibility="Hidden" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="ComboBoxToggleButton"
           TargetType="{x:Type ToggleButton}">
        <Setter Property="OverridesDefaultStyle"
                Value="True" />
        <Setter Property="IsTabStop"
                Value="False" />
        <Setter Property="Focusable"
                Value="True" />
        <Setter Property="ClickMode"
                Value="Press" />
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border x:Name="Chrome"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            Background="{TemplateBinding Background}"
                            SnapsToDevicePixels="true"
                            Margin="1"
                            Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}">
                        <Path x:Name="Arrow"
                              Data="M 0 0 L 3.5 4 L 7 0 Z"
                              Fill="Black"
                              HorizontalAlignment="Center"
                              Margin="0,1,0,0"
                              VerticalAlignment="Center" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver"
                                 Value="True">
                            <Setter Property="Background"
                                    TargetName="Chrome"
                                    Value="{StaticResource GrayBrush8}" />
                        </Trigger>
                        <Trigger Property="IsEnabled"
                                 Value="false">
                            <Setter Property="Fill"
                                    TargetName="Arrow"
                                    Value="{StaticResource GrayBrush11}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <ControlTemplate x:Key="ComboBoxEditableTemplate"
                     TargetType="{x:Type ComboBox}">
        <Grid x:Name="Placement"
              SnapsToDevicePixels="true">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Popup x:Name="PART_Popup"
                   AllowsTransparency="true"
                   Grid.ColumnSpan="2"
                   IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}"
                   PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}"
                   Placement="Bottom">
                <themes:SystemDropShadowChrome x:Name="Shdw"
                                               Color="Transparent"
                                               MaxHeight="{TemplateBinding MaxDropDownHeight}"
                                               MinWidth="{Binding ActualWidth, ElementName=Placement}">
                    <Border x:Name="DropDownBorder"
                            BorderBrush="{StaticResource ComboBoxPopupBrush}"
                            BorderThickness="1"
                            Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}">
                        <ScrollViewer x:Name="DropDownScrollViewer"
                                      BorderThickness="0"
                                      Padding="1"
                                      VerticalScrollBarVisibility="Auto">
                            <Grid RenderOptions.ClearTypeHint="Enabled">
                                <Canvas HorizontalAlignment="Left"
                                        Height="0"
                                        VerticalAlignment="Top"
                                        Width="0">
                                    <Rectangle x:Name="OpaqueRect"
                                               Fill="{Binding Background, ElementName=DropDownBorder}"
                                               Height="{Binding ActualHeight, ElementName=DropDownBorder}"
                                               Width="{Binding ActualWidth, ElementName=DropDownBorder}" />
                                </Canvas>
                                <ItemsPresenter x:Name="ItemsPresenter"
                                                KeyboardNavigation.DirectionalNavigation="Contained"
                                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            </Grid>
                        </ScrollViewer>
                    </Border>
                </themes:SystemDropShadowChrome>
            </Popup>
            <Grid x:Name="Border"
                  Grid.ColumnSpan="2">
                <Rectangle x:Name="Base"
                           Stroke="{TemplateBinding BorderBrush}"
                           StrokeThickness="{TemplateBinding BorderThickness}"
                           Fill="{StaticResource ControlBackgroundBrush}" />
                <Rectangle x:Name="FocusRectangle"
                           StrokeThickness="{TemplateBinding BorderThickness}"
                           Stroke="{StaticResource TextBoxMouseOverBorderBrush}"
                           Visibility="Collapsed" />
                <Rectangle x:Name="FocusInnerRectangle"
                           StrokeThickness="{TemplateBinding BorderThickness}"
                           Margin="1"
                           Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}"
                           Visibility="Collapsed" />
            </Grid>
            <TextBox x:Name="PART_EditableTextBox"
                     HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                     IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
                     Margin="{TemplateBinding Padding}"
                     Style="{StaticResource ComboBoxEditableTextBox}"
                     VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
            <ToggleButton Grid.Column="1"
                          IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                          Style="{StaticResource ComboBoxToggleButton}" />
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsKeyboardFocusWithin"
                     Value="true">
                <Setter Property="Foreground"
                        Value="Black" />
                <Setter Property="Visibility"
                        TargetName="FocusRectangle"
                        Value="Visible" />
                <Setter Property="Visibility"
                        TargetName="FocusInnerRectangle"
                        Value="Visible" />
            </Trigger>
            <Trigger Property="IsDropDownOpen"
                     Value="true">
                <Setter Property="Visibility"
                        TargetName="FocusRectangle"
                        Value="Visible" />
                <Setter Property="Visibility"
                        TargetName="FocusInnerRectangle"
                        Value="Visible" />
            </Trigger>
            <Trigger Property="IsFocused"
                     Value="true">
                <Setter Property="Visibility"
                        TargetName="FocusRectangle"
                        Value="Visible" />
                <Setter Property="Visibility"
                        TargetName="FocusInnerRectangle"
                        Value="Visible" />
            </Trigger>
            <Trigger Property="IsMouseOver"
                     Value="true">
                <Setter Property="Visibility"
                        TargetName="FocusRectangle"
                        Value="Visible" />
            </Trigger>
            <Trigger Property="HasItems"
                     Value="false">
                <Setter Property="Height"
                        TargetName="DropDownBorder"
                        Value="95" />
            </Trigger>
            <Trigger Property="IsEnabled"
                     Value="false">
                <Setter Property="Foreground"
                        Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
                <Setter Property="Background"
                        Value="#FFF4F4F4" />
            </Trigger>
            <Trigger Property="IsGrouping"
                     Value="true">
                <Setter Property="ScrollViewer.CanContentScroll"
                        Value="false" />
            </Trigger>
            <Trigger Property="HasDropShadow"
                     SourceName="PART_Popup"
                     Value="true">
                <Setter Property="Margin"
                        TargetName="Shdw"
                        Value="0,0,5,5" />
                <Setter Property="Color"
                        TargetName="Shdw"
                        Value="#71000000" />
            </Trigger>
            <Trigger Property="ScrollViewer.CanContentScroll"
                     SourceName="DropDownScrollViewer"
                     Value="false">
                <Setter Property="Canvas.Top"
                        TargetName="OpaqueRect"
                        Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}" />
                <Setter Property="Canvas.Left"
                        TargetName="OpaqueRect"
                        Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style TargetType="ComboBox"
           x:Key="DefaultComboBoxStyle">
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="Foreground"
                Value="{StaticResource TextBrush}" />
        <Setter Property="FontFamily"
                Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize"
                Value="{StaticResource ContentFontSize}" />
        <Setter Property="Background">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource Gray7}"
                                 PresentationOptions:Freeze="True" />
            </Setter.Value>
        </Setter>
        <Setter Property="HorizontalContentAlignment"
                Value="Left" />
        <Setter Property="VerticalContentAlignment"
                Value="Center" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="Padding"
                Value="3.5" />
        <Setter Property="KeyboardNavigation.TabNavigation"
                Value="Local" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility"
                Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility"
                Value="Auto" />
        <Setter Property="ScrollViewer.CanContentScroll"
                Value="True" />
        <Setter Property="BorderBrush"
                Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBox">
                    <Grid>
                        <Grid.Resources>
                            <Style x:Key="comboToggleStyle"
                                   TargetType="ToggleButton">
                                <Setter Property="Foreground"
                                        Value="{StaticResource TextBrush}" />
                                <Setter Property="Background"
                                        Value="{StaticResource GrayBrush7}" />
                                <Setter Property="BorderBrush"
                                        Value="{StaticResource TextBoxBorderBrush}" />
                                <Setter Property="BorderThickness"
                                        Value="1" />
                                <Setter Property="Padding"
                                        Value="3" />
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="ToggleButton">
                                            <Grid>
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualState x:Name="Normal" />
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                                               Storyboard.TargetName="MouseOverBorder">
                                                                    <EasingDoubleKeyFrame KeyTime="0"
                                                                                          Value="1" />
                                                                </DoubleAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                                               Storyboard.TargetName="PressedBorder">
                                                                    <EasingDoubleKeyFrame KeyTime="0"
                                                                                          Value="1" />
                                                                </DoubleAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Disabled" />
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CheckStates">
                                                        <vsm:VisualState x:Name="Checked">
                                                            <Storyboard>
                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                                               Storyboard.TargetName="CheckedRectangle">
                                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                                          Value="1" />
                                                                </DoubleAnimationUsingKeyFrames>
                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                                               Storyboard.TargetName="CheckedInnerRectangle">
                                                                    <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                                          Value="1" />
                                                                </DoubleAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unchecked" />
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused">
                                                            <Storyboard>
                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                                               Storyboard.TargetName="FocusRectangle">
                                                                    <EasingDoubleKeyFrame KeyTime="0"
                                                                                          Value="1" />
                                                                </DoubleAnimationUsingKeyFrames>
                                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                                               Storyboard.TargetName="FocusInnerRectangle">
                                                                    <EasingDoubleKeyFrame KeyTime="0"
                                                                                          Value="1" />
                                                                </DoubleAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unfocused" />
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Border x:Name="Background"
                                                        BorderBrush="{TemplateBinding BorderBrush}"
                                                        BorderThickness="{TemplateBinding BorderThickness}"
                                                        Background="{TemplateBinding Background}"
                                                        CornerRadius="3" />
                                                <Rectangle x:Name="DisabledVisualElement"
                                                           Fill="{StaticResource WhiteBrush}"
                                                           IsHitTestVisible="false"
                                                           Opacity="0"
                                                           RadiusY="3"
                                                           RadiusX="3" />
                                                <Border x:Name="MouseOverBorder"
                                                        Background="{StaticResource GrayBrush8}"
                                                        BorderThickness="{TemplateBinding BorderThickness}"
                                                        CornerRadius="3.5"
                                                        Opacity="0" />
                                                <Border x:Name="PressedBorder"
                                                        Background="{StaticResource GrayBrush5}"
                                                        BorderThickness="{TemplateBinding BorderThickness}"
                                                        CornerRadius="3.5"
                                                        Opacity="0" />
                                                <Rectangle x:Name="FocusRectangle"
                                                           Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}"
                                                           RadiusY="4"
                                                           RadiusX="4"
                                                           Margin="-1"
                                                           Opacity="0" />
                                                <Rectangle x:Name="FocusInnerRectangle"
                                                           StrokeThickness="{TemplateBinding BorderThickness}"
                                                           Stroke="{StaticResource TextBoxMouseOverBorderBrush}"
                                                           RadiusX="3"
                                                           RadiusY="3"
                                                           Opacity="0" />
                                                <Rectangle x:Name="CheckedRectangle"
                                                           StrokeThickness="{TemplateBinding BorderThickness}"
                                                           RadiusY="4"
                                                           RadiusX="4"
                                                           Opacity="0"
                                                           Stroke="{StaticResource TextBoxMouseOverBorderBrush}" />
                                                <Rectangle x:Name="CheckedInnerRectangle"
                                                           StrokeThickness="{TemplateBinding BorderThickness}"
                                                           RadiusY="4"
                                                           RadiusX="4"
                                                           Opacity="0"
                                                           Margin="1"
                                                           Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}" />
                                                <ContentPresenter x:Name="contentPresenter"
                                                                  ContentTemplate="{TemplateBinding ContentTemplate}"
                                                                  Content="{TemplateBinding Content}"
                                                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                                  Margin="{TemplateBinding Padding}"
                                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                                  RenderOptions.ClearTypeHint="Enabled" />
                                                <Rectangle x:Name="FocusVisualElement"
                                                           IsHitTestVisible="false"
                                                           Margin="1"
                                                           RadiusY="3.5"
                                                           RadiusX="3.5"
                                                           Stroke="{StaticResource HighlightBrush}"
                                                           StrokeThickness="1"
                                                           Visibility="Collapsed" />
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </Grid.Resources>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver" />
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="DisabledVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                                  Value="0.45" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="FocusRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="FocusInnerRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unfocused" />
                                <vsm:VisualState x:Name="FocusedDropDown">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00"
                                                                       Storyboard.TargetProperty="(UIElement.Visibility)"
                                                                       Storyboard.TargetName="PopupBorder">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="ValidationStates">
                                <vsm:VisualState x:Name="Valid" />
                                <vsm:VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen"
                                                                       Storyboard.TargetName="validationTooltip">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Boolean>True</sys:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border x:Name="ContentPresenterBorder">
                            <Grid>
                                <ToggleButton x:Name="DropDownToggle"
                                              IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
                                              ClickMode="Press"
                                              Focusable="false"
                                              BorderBrush="{TemplateBinding BorderBrush}"
                                              BorderThickness="{TemplateBinding BorderThickness}"
                                              Background="{TemplateBinding Background}"
                                              HorizontalAlignment="Stretch"
                                              HorizontalContentAlignment="Right"
                                              Margin="0"
                                              Style="{StaticResource comboToggleStyle}"
                                              VerticalAlignment="Stretch">
                                    <Path x:Name="BtnArrow"
                                          Data="F1 M 301.14,-189.041L 311.57,-189.041L 306.355,-182.942L 301.14,-189.041 Z "
                                          HorizontalAlignment="Right"
                                          Height="4"
                                          Margin="0,0,6,0"
                                          Stretch="Uniform"
                                          Width="8">
                                        <Path.Fill>
                                            <SolidColorBrush x:Name="BtnArrowColor"
                                                             Color="{StaticResource Gray3}"
                                                             PresentationOptions:Freeze="True" />
                                        </Path.Fill>
                                    </Path>
                                </ToggleButton>
                                <ContentPresenter x:Name="ContentPresenter"
                                                  IsHitTestVisible="False"
                                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                                  Content="{TemplateBinding SelectionBoxItem}"
                                                  ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                                                  ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                  Margin="{TemplateBinding Padding}"
                                                  RenderOptions.ClearTypeHint="Enabled" />
                            </Grid>
                        </Border>
                        <Rectangle x:Name="FocusRectangle"
                                   Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}"
                                   RadiusY="4"
                                   RadiusX="4"
                                   Margin="-1"
                                   Opacity="0" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   StrokeThickness="{TemplateBinding BorderThickness}"
                                   Stroke="{StaticResource TextBoxMouseOverBorderBrush}"
                                   RadiusX="3"
                                   RadiusY="3"
                                   Opacity="0" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{StaticResource DisabledWhiteColorBrush}"
                                   IsHitTestVisible="false"
                                   RadiusX="3"
                                   RadiusY="3"
                                   Opacity="0" />
                        <Border x:Name="ValidationErrorElement"
                                BorderBrush="{StaticResource ControlsValidationBrush}"
                                BorderThickness="1"
                                CornerRadius="3"
                                Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip"
                                         DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Placement="Right"
                                         PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Template="{StaticResource ValidationToolTipTemplate}" />
                            </ToolTipService.ToolTip>
                            <Grid Background="Transparent"
                                  HorizontalAlignment="Right"
                                  Height="12"
                                  Margin="1,-4,-4,0"
                                  VerticalAlignment="Top"
                                  Width="12">
                                <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"
                                      Fill="{StaticResource ValidationBrush5}"
                                      Margin="1,3,0,0" />
                                <Path Data="M 0,0 L2,0 L 8,6 L8,8"
                                      Fill="{StaticResource WhiteColorBrush}"
                                      Margin="1,3,0,0" />
                            </Grid>
                        </Border>
                        <Popup x:Name="PART_Popup"
                               Placement="Bottom"
                               IsOpen="{TemplateBinding IsDropDownOpen}"
                               AllowsTransparency="True"
                               Focusable="False"
                               PopupAnimation="Fade">
                            <Border x:Name="PopupBorder"
                                    MinWidth="{TemplateBinding ActualWidth}"
                                    MaxHeight="{TemplateBinding MaxDropDownHeight}"
                                    BorderBrush="{StaticResource ComboBoxPopupBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    Background="{StaticResource WhiteBrush}"
                                    Effect="{StaticResource DropShadowBrush}">
                                <ScrollViewer x:Name="ScrollViewer"
                                              BorderThickness="0"
                                              Padding="1"
                                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
                                              HorizontalScrollBarVisibility="Auto"
                                              VerticalScrollBarVisibility="Auto"
                                              CanContentScroll="True">
                                    <ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained" />
                                </ScrollViewer>
                            </Border>
                        </Popup>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsGrouping"
                                 Value="True">
                            <Setter Property="ScrollViewer.CanContentScroll"
                                    Value="False" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsEditable"
                     Value="true">
                <Setter Property="Background"
                        Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
                <Setter Property="IsTabStop"
                        Value="false" />
                <Setter Property="Padding"
                        Value="3,2,3,3" />
                <Setter Property="Template"
                        Value="{StaticResource ComboBoxEditableTemplate}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--ComboBoxItem Style-->
    <Style TargetType="ComboBoxItem"
           x:Key="DefaultComboBoxItemStyle"
           d:IsControlPart="True">
        <!--<Setter Property="OverridesDefaultStyle" Value="True" />-->
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="Foreground"
                Value="{StaticResource TextBrush}" />
        <Setter Property="Padding"
                Value="3" />
        <Setter Property="HorizontalContentAlignment"
                Value="Left" />
        <Setter Property="VerticalContentAlignment"
                Value="Top" />
        <Setter Property="Background"
                Value="{StaticResource TransparentWhiteBrush}" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="KeyboardNavigation.DirectionalNavigation"
                Value="Once" />
        <Setter Property="KeyboardNavigation.TabNavigation"
                Value="Local" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBoxItem">
                    <Grid Background="{TemplateBinding Background}"
                          Margin="0,0.5"
                          VerticalAlignment="Stretch">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="MouseOverRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value=".65" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenterWrapperColor"
                                                                      Storyboard.TargetProperty="Color">
                                            <EasingColorKeyFrame KeyTime="0"
                                                                 Value="{StaticResource HoverForegroundColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="contentPresenter">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="SelectionStates">
                                <vsm:VisualState x:Name="Unselected" />
                                <vsm:VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="SelectedRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenterWrapperColor"
                                                                      Storyboard.TargetProperty="Color">
                                            <EasingColorKeyFrame KeyTime="0"
                                                                 Value="{StaticResource HoverForegroundColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="SelectedUnfocused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="SelectedRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenterWrapperColor"
                                                                      Storyboard.TargetProperty="Color">
                                            <EasingColorKeyFrame KeyTime="0"
                                                                 Value="{StaticResource HoverForegroundColor}" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Focused">
                                    <Storyboard />
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unfocused" />
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="SelectedRectangle"
                                   IsHitTestVisible="False"
                                   Opacity="0"
                                   Fill="{StaticResource HighlightBrush}" />
                        <Rectangle x:Name="MouseOverRectangle"
                                   IsHitTestVisible="False"
                                   Opacity="0"
                                   Fill="{StaticResource HighlightBrush}" />
                        <ContentControl IsTabStop="False">
                            <ContentControl.Foreground>
                                <SolidColorBrush x:Name="ContentPresenterWrapperColor"
                                                 Color="{StaticResource NormalForegroundColor}"
                                                 PresentationOptions:Freeze="True" />
                            </ContentControl.Foreground>
                            <ContentPresenter x:Name="contentPresenter"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              Content="{TemplateBinding Content}"
                                              ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              Margin="{TemplateBinding Padding}"
                                              RenderOptions.ClearTypeHint="Enabled" />
                        </ContentControl>
                        <Rectangle x:Name="FocusVisualElement"
                                   RadiusY="1"
                                   RadiusX="1"
                                   Stroke="{StaticResource HighlightBrush}"
                                   StrokeThickness="1"
                                   Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--TextBlock Style-->
    <Style TargetType="TextBlock"
           x:Key="DefaultTextBlockStyle">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="FontFamily"
                Value="{StaticResource ContentFontFamily}" />
        <Setter Property="TextOptions.TextFormattingMode"
                Value="Display" />
        <Setter Property="TextOptions.TextRenderingMode"
                Value="ClearType" />
        <!--<Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}"/>-->
    </Style>

    <!--ScrollBar Styles & Templates-->
    <ControlTemplate x:Key="HorizontalScrollBarTemplate"
                     TargetType="ScrollBar">
        <Grid x:Name="Root">
            <Grid.Resources>
                <ControlTemplate x:Key="RepeatButtonTemplate"
                                 TargetType="RepeatButton">
                    <Grid x:Name="Root"
                          Background="Transparent">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="HorizontalIncrementTemplate"
                                 TargetType="RepeatButton">
                    <Grid x:Name="Root">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="HoverPath">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Blur">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard />
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Root">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Path Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z "
                              Height="6"
                              Stretch="Uniform"
                              Width="4">
                            <Path.Fill>
                                <SolidColorBrush Color="{StaticResource Gray2}"
                                                 PresentationOptions:Freeze="True" />
                            </Path.Fill>
                        </Path>
                        <Path x:Name="HoverPath"
                              Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z "
                              Height="6"
                              Stretch="Uniform"
                              Width="4"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="1,1,0,0">
                            <Path.Fill>
                                <SolidColorBrush Color="{StaticResource BlackColor}"
                                                 PresentationOptions:Freeze="True" />
                            </Path.Fill>
                        </Path>
                        <Path x:Name="Blur"
                              Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z "
                              Height="6"
                              Stretch="Uniform"
                              Width="4"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="1,1,0,0">
                            <Path.Effect>
                                <BlurEffect />
                            </Path.Effect>
                            <Path.Fill>
                                <SolidColorBrush Color="{StaticResource BlackColor}"
                                                 PresentationOptions:Freeze="True" />
                            </Path.Fill>
                        </Path>
                        <Rectangle x:Name="DisabledElement"
                                   Fill="{StaticResource WhiteColorBrush}"
                                   Opacity="0"
                                   RadiusY="2"
                                   RadiusX="2" />
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="HorizontalDecrementTemplate"
                                 TargetType="RepeatButton">
                    <Grid x:Name="Root">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="HoverPath">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Blur">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard />
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Root">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Path Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z "
                              Height="6"
                              Stretch="Uniform"
                              Width="4">
                            <Path.Fill>
                                <SolidColorBrush Color="{StaticResource Gray2}"
                                                 PresentationOptions:Freeze="True" />
                            </Path.Fill>
                        </Path>
                        <Path x:Name="HoverPath"
                              Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z "
                              Height="6"
                              Stretch="Uniform"
                              Width="4"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="0,1,0,0">
                            <Path.Fill>
                                <SolidColorBrush Color="{StaticResource BlackColor}"
                                                 PresentationOptions:Freeze="True" />
                            </Path.Fill>
                        </Path>
                        <Path x:Name="Blur"
                              Data="F1 M 110.692,342.252L 110.692,352.682L 104.594,347.467L 110.692,342.252 Z "
                              Height="6"
                              Stretch="Uniform"
                              Width="4"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="0,1,0,0">
                            <Path.Effect>
                                <BlurEffect />
                            </Path.Effect>
                            <Path.Fill>
                                <SolidColorBrush Color="{StaticResource BlackColor}"
                                                 PresentationOptions:Freeze="True" />
                            </Path.Fill>
                        </Path>
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="HorizontalThumbTemplate"
                                 TargetType="Thumb">
                    <Grid>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="MouseOverRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="PressedRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="ThumbVisual">
                                            <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                  Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Grid x:Name="ThumbVisual"
                              Margin="0,1,0,1">
                            <Rectangle x:Name="Background"
                                       StrokeThickness="1"
                                       Fill="{StaticResource ThumbBrush}" />
                            <Rectangle x:Name="MouseOverRectangle"
                                       StrokeThickness="1"
                                       Opacity="0"
                                       Fill="{StaticResource BlackBrush}" />
                            <Rectangle x:Name="PressedRectangle"
                                       StrokeThickness="1"
                                       Opacity="0"
                                       Fill="{StaticResource BlackBrush}" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Grid.Resources>
            <vsm:VisualStateManager.VisualStateGroups>
                <vsm:VisualStateGroup x:Name="CommonStates">
                    <vsm:VisualState x:Name="Normal" />
                    <vsm:VisualState x:Name="MouseOver" />
                    <vsm:VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                           Storyboard.TargetName="Root">
                                <SplineDoubleKeyFrame KeyTime="0"
                                                      Value="0.5" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </vsm:VisualState>
                </vsm:VisualStateGroup>
            </vsm:VisualStateManager.VisualStateGroups>
            <Grid x:Name="HorizontalRoot"
                  Height="11">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <Border BorderThickness="0,0,0,1"
                        Grid.RowSpan="1"
                        Margin="0,0,0,-1"
                        Grid.ColumnSpan="3"
                        Visibility="Collapsed">
                    <Border.BorderBrush>
                        <SolidColorBrush Color="{StaticResource Gray4}"
                                         PresentationOptions:Freeze="True" />
                    </Border.BorderBrush>
                </Border>

                <RepeatButton x:Name="HorizontalSmallDecrease"
                              Grid.Column="0"
                              Interval="50"
                              IsTabStop="False"
                              Width="16"
                              Margin="1"
                              Template="{StaticResource HorizontalDecrementTemplate}"
                              Command="ScrollBar.LineLeftCommand"
                              Visibility="{Binding ElementName=PART_Track, Path=Visibility}" />

                <Track x:Name="PART_Track"
                       Grid.Column="1"
                       Orientation="Horizontal">
                    <Track.DecreaseRepeatButton>
                        <RepeatButton x:Name="HorizontalLargeDecrease"
                                      IsTabStop="False"
                                      Interval="50"
                                      Template="{StaticResource RepeatButtonTemplate}"
                                      Command="ScrollBar.PageLeftCommand" />
                    </Track.DecreaseRepeatButton>
                    <Track.Thumb>
                        <Thumb x:Name="HorizontalThumb"
                               Background="{TemplateBinding Background}"
                               Grid.Column="2"
                               MinWidth="18"
                               Template="{StaticResource HorizontalThumbTemplate}"
                               Width="18"
                               HorizontalAlignment="Stretch" />
                    </Track.Thumb>
                    <Track.IncreaseRepeatButton>
                        <RepeatButton x:Name="HorizontalLargeIncrease"
                                      IsTabStop="False"
                                      Interval="50"
                                      Template="{StaticResource RepeatButtonTemplate}"
                                      Command="ScrollBar.PageRightCommand" />
                    </Track.IncreaseRepeatButton>
                </Track>

                <RepeatButton x:Name="HorizontalSmallIncrease"
                              Grid.Column="2"
                              IsTabStop="False"
                              Interval="50"
                              Width="16"
                              Margin="1"
                              Template="{StaticResource HorizontalIncrementTemplate}"
                              Command="ScrollBar.LineRightCommand"
                              Visibility="{Binding ElementName=PART_Track, Path=Visibility}" />
            </Grid>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="VerticalScrollBarTemplate"
                     TargetType="ScrollBar">
        <Grid x:Name="Root">
            <Grid.Resources>
                <ControlTemplate x:Key="RepeatButtonTemplate"
                                 TargetType="RepeatButton">
                    <Grid x:Name="Root"
                          Background="Transparent">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="VerticalIncrementTemplate"
                                 TargetType="RepeatButton">
                    <Grid x:Name="Root">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="HoverPath">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Blur">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard />
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Root">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Path Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "
                              Height="4"
                              Stretch="Uniform"
                              Width="6">
                            <Path.Fill>
                                <SolidColorBrush x:Name="ButtonColor"
                                                 Color="{StaticResource Gray3}"
                                                 PresentationOptions:Freeze="True" />
                            </Path.Fill>
                        </Path>
                        <Path x:Name="HoverPath"
                              Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "
                              Height="4"
                              Stretch="Uniform"
                              Width="6"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="1,0,0,0">
                            <Path.Fill>
                                <SolidColorBrush Color="{StaticResource BlackColor}"
                                                 PresentationOptions:Freeze="True" />
                            </Path.Fill>
                        </Path>
                        <Path x:Name="Blur"
                              Data="F1 M 531.107,321.943L 541.537,321.943L 536.322,328.042L 531.107,321.943 Z "
                              Height="4"
                              Stretch="Uniform"
                              Width="6"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="1,0,0,0">
                            <Path.Effect>
                                <BlurEffect />
                            </Path.Effect>
                            <Path.Fill>
                                <SolidColorBrush Color="{StaticResource BlackColor}"
                                                 PresentationOptions:Freeze="True" />
                            </Path.Fill>
                        </Path>
                        <Rectangle x:Name="DisabledElement"
                                   Fill="{StaticResource WhiteColorBrush}"
                                   Opacity="0"
                                   RadiusY="2"
                                   RadiusX="2" />
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="VerticalDecrementTemplate"
                                 TargetType="RepeatButton">
                    <Grid x:Name="Root">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="HoverPath">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Blur">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard />
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Root">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="Background"
                                   Fill="{StaticResource ControlBackgroundBrush}"
                                   Opacity="0"
                                   RadiusY="2"
                                   RadiusX="2"
                                   StrokeThickness="1" />
                        <Rectangle x:Name="BackgroundMouseOver"
                                   Fill="{StaticResource HighlightBrush}"
                                   Opacity="0"
                                   RadiusY="2"
                                   RadiusX="2" />
                        <Rectangle x:Name="BackgroundPressed"
                                   Fill="{StaticResource HighlightBrush}"
                                   Opacity="0"
                                   RadiusY="2"
                                   RadiusX="2" />
                        <Rectangle x:Name="BackgroundGradient"
                                   Fill="{StaticResource TransparentWhiteBrush}"
                                   Margin="1"
                                   Opacity="0"
                                   RadiusY="1"
                                   RadiusX="1"
                                   Stroke="{StaticResource ControlBackgroundBrush}"
                                   StrokeThickness="1" />
                        <Rectangle x:Name="Highlight"
                                   IsHitTestVisible="false"
                                   Margin="1"
                                   Opacity="0"
                                   RadiusY="1"
                                   RadiusX="1"
                                   Stroke="{StaticResource HighlightBrush}"
                                   StrokeThickness="1" />
                        <Path Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "
                              Height="4"
                              Stretch="Uniform"
                              Width="6">
                            <Path.Fill>
                                <SolidColorBrush Color="{StaticResource Gray2}"
                                                 PresentationOptions:Freeze="True" />
                            </Path.Fill>
                        </Path>
                        <Path x:Name="HoverPath"
                              Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "
                              Height="4"
                              Stretch="Uniform"
                              Width="6"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="1,0,0,0">
                            <Path.Fill>
                                <SolidColorBrush Color="{StaticResource BlackColor}"
                                                 PresentationOptions:Freeze="True" />
                            </Path.Fill>
                        </Path>
                        <Path x:Name="Blur"
                              Data="F1 M 541.537,173.589L 531.107,173.589L 536.322,167.49L 541.537,173.589 Z "
                              Height="4"
                              Stretch="Uniform"
                              Width="6"
                              UseLayoutRounding="False"
                              Opacity="0"
                              Margin="1,0,0,0">
                            <Path.Effect>
                                <BlurEffect />
                            </Path.Effect>
                            <Path.Fill>
                                <SolidColorBrush Color="{StaticResource BlackColor}"
                                                 PresentationOptions:Freeze="True" />
                            </Path.Fill>
                        </Path>
                    </Grid>
                </ControlTemplate>
                <ControlTemplate x:Key="VerticalThumbTemplate"
                                 TargetType="Thumb">
                    <Grid>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="MouseOverRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>

                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="PressedRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="ThumbVisual">
                                            <SplineDoubleKeyFrame KeyTime="0:0:0"
                                                                  Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Grid x:Name="ThumbVisual"
                              Margin="1,0,1,0">
                            <Rectangle x:Name="Background"
                                       StrokeThickness="1"
                                       Fill="{StaticResource ThumbBrush}" />
                            <Rectangle x:Name="MouseOverRectangle"
                                       StrokeThickness="1"
                                       Opacity="0"
                                       Fill="{StaticResource BlackBrush}" />
                            <Rectangle x:Name="PressedRectangle"
                                       StrokeThickness="1"
                                       Opacity="0"
                                       Fill="{StaticResource BlackBrush}" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Grid.Resources>
            <vsm:VisualStateManager.VisualStateGroups>
                <vsm:VisualStateGroup x:Name="CommonStates">
                    <vsm:VisualState x:Name="Normal" />
                    <vsm:VisualState x:Name="MouseOver" />
                    <vsm:VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                           Storyboard.TargetName="Root">
                                <SplineDoubleKeyFrame KeyTime="0"
                                                      Value="0.5" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </vsm:VisualState>
                </vsm:VisualStateGroup>
            </vsm:VisualStateManager.VisualStateGroups>
            <Grid x:Name="VerticalRoot"
                  Width="11">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Border BorderThickness="0,0,1,0"
                        Margin="0,0,-1,0"
                        Grid.RowSpan="3"
                        Visibility="Collapsed">
                    <Border.BorderBrush>
                        <SolidColorBrush Color="{StaticResource Gray4}"
                                         PresentationOptions:Freeze="True" />
                    </Border.BorderBrush>
                </Border>

                <RepeatButton x:Name="VerticalSmallDecrease"
                              Grid.Row="0"
                              IsTabStop="False"
                              Interval="50"
                              Height="16"
                              Margin="1"
                              Template="{StaticResource VerticalDecrementTemplate}"
                              Command="ScrollBar.LineUpCommand"
                              Visibility="{Binding ElementName=PART_Track, Path=Visibility}" />

                <Track x:Name="PART_Track"
                       Grid.Row="1"
                       IsDirectionReversed="True"
                       Orientation="Vertical">
                    <Track.DecreaseRepeatButton>
                        <RepeatButton x:Name="VerticalLargeDecrease"
                                      Interval="50"
                                      IsTabStop="False"
                                      Template="{StaticResource RepeatButtonTemplate}"
                                      Command="ScrollBar.PageUpCommand" />
                    </Track.DecreaseRepeatButton>
                    <Track.Thumb>
                        <Thumb x:Name="VerticalThumb"
                               Height="Auto"
                               MinHeight="18"
                               Template="{StaticResource VerticalThumbTemplate}"
                               VerticalAlignment="Stretch" />
                    </Track.Thumb>
                    <Track.IncreaseRepeatButton>
                        <RepeatButton x:Name="VerticalLargeIncrease"
                                      IsTabStop="False"
                                      Interval="50"
                                      Template="{StaticResource RepeatButtonTemplate}"
                                      Command="ScrollBar.PageDownCommand" />
                    </Track.IncreaseRepeatButton>
                </Track>

                <RepeatButton x:Name="VerticalSmallIncrease"
                              Grid.Row="2"
                              IsTabStop="False"
                              Interval="50"
                              Height="16"
                              Margin="1"
                              Template="{StaticResource VerticalIncrementTemplate}"
                              Command="ScrollBar.LineDownCommand"
                              Visibility="{Binding ElementName=PART_Track, Path=Visibility}" />
            </Grid>
        </Grid>
    </ControlTemplate>

    <Style x:Key="DefaultScrollBarStyle"
           TargetType="ScrollBar">
        <Setter Property="OverridesDefaultStyle"
                Value="True" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="Foreground"
                Value="{StaticResource TextBrush}" />
        <Setter Property="Background"
                Value="{StaticResource ControlBackgroundBrush}" />
        <Setter Property="MinWidth"
                Value="20" />
        <Setter Property="MinHeight"
                Value="20" />
        <Setter Property="IsTabStop"
                Value="False" />
        <Style.Triggers>
            <Trigger Property="Orientation"
                     Value="Horizontal">
                <Setter Property="Width"
                        Value="Auto" />
                <Setter Property="Template"
                        Value="{StaticResource HorizontalScrollBarTemplate}" />
            </Trigger>
            <Trigger Property="Orientation"
                     Value="Vertical">
                <Setter Property="Height"
                        Value="Auto" />
                <Setter Property="Template"
                        Value="{StaticResource VerticalScrollBarTemplate}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--ScrollViewer Style-->
    <Style x:Key="DefaultScrollViewerStyle"
           TargetType="ScrollViewer">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="Foreground"
                Value="{StaticResource TextBrush}" />
        <Setter Property="Background"
                Value="{StaticResource ControlBackgroundBrush}" />
        <Setter Property="HorizontalContentAlignment"
                Value="Left" />
        <Setter Property="VerticalContentAlignment"
                Value="Top" />
        <Setter Property="VerticalScrollBarVisibility"
                Value="Visible" />
        <Setter Property="Padding"
                Value="4" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="BorderBrush">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource Gray4}"
                                 PresentationOptions:Freeze="True" />
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ScrollViewer">
                    <Border BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid Background="{TemplateBinding Background}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <ScrollContentPresenter x:Name="ScrollContentPresenter"
                                                    Grid.Column="0"
                                                    Grid.Row="0"
                                                    Cursor="{TemplateBinding Cursor}"
                                                    Margin="{TemplateBinding Padding}"
                                                    Content="{TemplateBinding Content}"
                                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                                    CanContentScroll="{TemplateBinding CanContentScroll}" />
                            <Rectangle Grid.Column="1"
                                       Grid.Row="1"
                                       Visibility="Collapsed" />
                            <ScrollBar x:Name="PART_VerticalScrollBar"
                                       Grid.Column="1"
                                       IsTabStop="False"
                                       Maximum="{TemplateBinding ScrollableHeight}"
                                       Margin="0,-1,-3,-1"
                                       Minimum="0"
                                       Orientation="Vertical"
                                       Grid.Row="0"
                                       Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                                       Value="{TemplateBinding VerticalOffset}"
                                       ViewportSize="{TemplateBinding ViewportHeight}"
                                       Width="18" />
                            <ScrollBar x:Name="PART_HorizontalScrollBar"
                                       Grid.Column="0"
                                       Height="18"
                                       IsTabStop="False"
                                       Maximum="{TemplateBinding ScrollableWidth}"
                                       Margin="-1,0,-1,-3"
                                       Minimum="0"
                                       Orientation="Horizontal"
                                       Grid.Row="1"
                                       Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"
                                       Value="{TemplateBinding HorizontalOffset}"
                                       ViewportSize="{TemplateBinding ViewportWidth}" />
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--ListBox Style -->
    <Style TargetType="ListBox"
           x:Key="DefaultListBoxStyle">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="Padding"
                Value="1" />
        <Setter Property="Foreground"
                Value="{StaticResource TextBrush}" />
        <Setter Property="FontFamily"
                Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize"
                Value="{StaticResource ContentFontSize}" />
        <Setter Property="Background"
                Value="{StaticResource ControlBackgroundBrush}" />
        <Setter Property="HorizontalContentAlignment"
                Value="Left" />
        <Setter Property="VerticalContentAlignment"
                Value="Top" />
        <Setter Property="IsTabStop"
                Value="False" />
        <Setter Property="KeyboardNavigation.TabNavigation"
                Value="Once" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility"
                Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility"
                Value="Auto" />
        <Setter Property="ScrollViewer.CanContentScroll"
                Value="true" />
        <Setter Property="BorderBrush"
                Value="{StaticResource ThumbBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBox">
                    <Grid>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="ValidationStates">
                                <vsm:VisualState x:Name="Valid" />
                                <vsm:VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen"
                                                                       Storyboard.TargetName="validationTooltip">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Boolean>True</sys:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}">
                            <ScrollViewer x:Name="ScrollViewer"
                                          BorderBrush="Transparent"
                                          BorderThickness="0"
                                          Background="{TemplateBinding Background}"
                                          Padding="{TemplateBinding Padding}"
                                          HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
                                          VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
                                <ItemsPresenter />
                            </ScrollViewer>
                        </Border>
                        <Border x:Name="ValidationErrorElement"
                                BorderBrush="{StaticResource ControlsValidationBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="2"
                                Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip"
                                         IsHitTestVisible="True"
                                         DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Placement="Right"
                                         PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Template="{StaticResource ValidationToolTipTemplate}" />
                            </ToolTipService.ToolTip>
                            <Grid Background="Transparent"
                                  HorizontalAlignment="Right"
                                  Height="10"
                                  Margin="0,-4,-4,0"
                                  VerticalAlignment="Top"
                                  Width="10">
                                <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"
                                      Fill="{StaticResource ValidationBrush5}"
                                      Margin="-1,3,0,0" />
                                <Path Data="M 0,0 L2,0 L 8,6 L8,8"
                                      Fill="{StaticResource WhiteColorBrush}"
                                      Margin="-1,3,0,0" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderThickness"
                Value="0" />
    </Style>

    <!--ListBoxItem Style-->
    <Style TargetType="ListBoxItem"
           x:Key="DefaultListBoxItemStyle"
           d:IsControlPart="True">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="FontFamily"
                Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize"
                Value="{StaticResource ContentFontSize}" />
        <Setter Property="Padding"
                Value="10" />
        <Setter Property="Margin"
                Value="0" />
        <Setter Property="HorizontalContentAlignment"
                Value="Left" />
        <Setter Property="VerticalContentAlignment"
                Value="Center" />
        <Setter Property="Background"
                Value="Transparent" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="KeyboardNavigation.TabNavigation"
                Value="Local" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Grid Background="{TemplateBinding Background}">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To=".55"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Storyboard.TargetName="fillColor" />
                                        <ColorAnimation Duration="0"
                                                        To="{StaticResource HoverForegroundColor}"
                                                        Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)"
                                                        Storyboard.TargetName="contentControl" />
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To=".55"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Storyboard.TargetName="contentPresenter" />
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="SelectionStates">
                                <vsm:VisualState x:Name="Unselected" />
                                <vsm:VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                        To="{StaticResource HoverForegroundColor}"
                                                        Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)"
                                                        Storyboard.TargetName="contentControl" />
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         Storyboard.TargetName="fillColor" />
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="SelectedUnfocused" />
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="FocusVisualElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         Storyboard.TargetName="fillColor2" />
                                        <ColorAnimation Duration="0"
                                                        To="{StaticResource HoverForegroundColor}"
                                                        Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)"
                                                        Storyboard.TargetName="contentControl" />
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unfocused" />
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="fillColor"
                                   Fill="{StaticResource HighlightBrush}"
                                   IsHitTestVisible="False"
                                   Opacity="0"
                                   RadiusY="1"
                                   RadiusX="1" />
                        <Rectangle x:Name="fillColor2"
                                   Fill="{StaticResource HighlightBrush}"
                                   IsHitTestVisible="False"
                                   Opacity="0"
                                   RadiusY="1"
                                   RadiusX="1" />
                        <ContentControl x:Name="contentControl"
                                        Foreground="{TemplateBinding Foreground}">
                            <ContentPresenter x:Name="contentPresenter"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              Content="{TemplateBinding Content}"
                                              VerticalAlignment="Center"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              Margin="7"
                                              RenderOptions.ClearTypeHint="Enabled" />
                        </ContentControl>
                        <Rectangle x:Name="FocusVisualElement"
                                   RadiusY="1"
                                   RadiusX="1"
                                   Stroke="{StaticResource HighlightBrush}"
                                   StrokeThickness="1"
                                   Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--CheckBox Style-->
    <Style TargetType="CheckBox"
           x:Key="DefaultCheckBoxStyle">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="FontFamily"
                Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize"
                Value="{StaticResource ContentFontSize}" />
        <Setter Property="Background"
                Value="{StaticResource CheckBoxBackgroundBrush}" />
        <Setter Property="Foreground"
                Value="{StaticResource TextBrush}" />
        <Setter Property="HorizontalContentAlignment"
                Value="Left" />
        <Setter Property="VerticalContentAlignment"
                Value="Center" />
        <Setter Property="Padding"
                Value="5,0,0,0" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="BorderBrush"
                Value="{StaticResource CheckBoxBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CheckBox">
                    <Grid>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="MouseOverRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenterWrapperColor"
                                                                      Storyboard.TargetProperty="Color">
                                            <EasingColorKeyFrame KeyTime="0"
                                                                 Value="{StaticResource Gray2}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="grid">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="PressedRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="contentPresenter">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="DisabledVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value="0.55" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="CheckStates">
                                <vsm:VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="CheckIcon">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unchecked" />
                                <vsm:VisualState x:Name="Indeterminate">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="IndeterminateIcon">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Focused">
                                    <Storyboard />
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unfocused" />
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="ValidationStates">
                                <vsm:VisualState x:Name="Valid" />
                                <vsm:VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen"
                                                                       Storyboard.TargetName="validationTooltip">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Boolean>True</sys:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="16" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid HorizontalAlignment="Left"
                              VerticalAlignment="Center">
                            <Grid x:Name="grid"
                                  Height="14"
                                  Width="14"
                                  Opacity="0.7">
                                <Rectangle x:Name="Background"
                                           Fill="{TemplateBinding Background}"
                                           Stroke="{TemplateBinding BorderBrush}"
                                           StrokeThickness="{TemplateBinding BorderThickness}" />
                                <Rectangle x:Name="MouseOverRectangle"
                                           Stroke="{StaticResource CheckBoxMouseOverBrush}"
                                           Opacity="0" />
                                <Rectangle x:Name="PressedRectangle"
                                           Stroke="{StaticResource BlackBrush}"
                                           Opacity="0" />
                                <Path Opacity="0"
                                      x:Name="CheckIcon"
                                      Data="M49.4375,110.4375 L51.4995,112.812 L56.3745,107.24883"
                                      HorizontalAlignment="Center"
                                      Height="7.6"
                                      Stretch="Fill"
                                      Stroke="Black"
                                      UseLayoutRounding="False"
                                      VerticalAlignment="Center"
                                      Width="8.9"
                                      StrokeStartLineCap="Triangle"
                                      StrokeEndLineCap="Triangle"
                                      StrokeThickness="2" />
                                <Rectangle x:Name="IndeterminateIcon"
                                           Height="8"
                                           Width="8"
                                           Opacity="0">
                                    <Rectangle.Fill>
                                        <SolidColorBrush Color="{StaticResource Gray3}"
                                                         PresentationOptions:Freeze="True" />
                                    </Rectangle.Fill>
                                </Rectangle>
                                <Rectangle x:Name="DisabledVisualElement"
                                           Fill="{StaticResource DisabledWhiteColorBrush}"
                                           Opacity="0"
                                           RadiusY="1"
                                           RadiusX="1" />
                            </Grid>
                            <Border x:Name="ValidationErrorElement"
                                    BorderBrush="{StaticResource ControlsValidationBrush}"
                                    BorderThickness="1"
                                    CornerRadius="1"
                                    Margin="1"
                                    ToolTipService.PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                    Visibility="Collapsed">
                                <ToolTipService.ToolTip>
                                    <ToolTip x:Name="validationTooltip"
                                             IsHitTestVisible="True"
                                             DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                             Placement="Right"
                                             PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                             Template="{StaticResource ValidationToolTipTemplate}" />
                                </ToolTipService.ToolTip>
                                <Grid Background="Transparent"
                                      HorizontalAlignment="Right"
                                      Height="10"
                                      Margin="0,-4,-4,0"
                                      VerticalAlignment="Top"
                                      Width="10">
                                    <Path Data="M 1,0 L5,0 A 2,2 90 0 1 7,2 L7,6 z"
                                          Fill="{StaticResource ValidationBrush5}"
                                          Margin="0,3,0,0" />
                                    <Path Data="M 0,0 L2,0 L 7,5 L7,7"
                                          Fill="{StaticResource WhiteColorBrush}"
                                          Margin="0,3,0,0" />
                                </Grid>
                            </Border>
                        </Grid>
                        <ContentControl x:Name="ContentRoot"
                                        Grid.Column="1"
                                        Focusable="False">
                            <ContentControl.Foreground>
                                <SolidColorBrush x:Name="ContentPresenterWrapperColor"
                                                 Color="{StaticResource BlackColor}"
                                                 PresentationOptions:Freeze="True" />
                            </ContentControl.Foreground>

                            <AccessText x:Name="contentPresenter"
                                        FontFamily="{TemplateBinding FontFamily}"
                                        FontSize="{TemplateBinding FontSize}"
                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                        Text="{TemplateBinding Content}"
                                        Margin="{TemplateBinding Padding}" />
                        </ContentControl>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasContent"
                                 Value="False">
                            <Setter TargetName="ContentRoot"
                                    Property="Visibility"
                                    Value="Collapsed" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--PasswordBox Style-->
    <Style TargetType="PasswordBox"
           x:Key="DefaultPasswordBoxStyle">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="FontFamily"
                Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize"
                Value="{StaticResource ContentFontSize}" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="FocusVisualStyle"
                Value="{x:Null}" />
        <Setter Property="MinHeight"
                Value="26" />
        <Setter Property="Background"
                Value="{StaticResource ControlBackgroundBrush}" />
        <Setter Property="Foreground">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource TextBoxText}"
                                 PresentationOptions:Freeze="True" />
            </Setter.Value>
        </Setter>
        <Setter Property="Padding"
                Value="0" />
        <Setter Property="BorderBrush"
                Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="PasswordBox">
                    <Grid x:Name="RootElement">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         Storyboard.TargetName="FocusRectangle" />
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="DisabledVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="ReadOnly">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="ReadOnlyVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         Storyboard.TargetName="FocusRectangle" />
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="(UIElement.Opacity)"
                                                         Storyboard.TargetName="FocusInnerRectangle" />
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unfocused">
                                    <Storyboard />
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="ValidationStates">
                                <vsm:VisualState x:Name="Valid" />
                                <vsm:VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen"
                                                                       Storyboard.TargetName="validationTooltip">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Boolean>True</sys:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>

                        <Rectangle x:Name="Base"
                                   Stroke="{TemplateBinding BorderBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}"
                                   Opacity="1"
                                   Fill="{StaticResource ControlBackgroundBrush}" />
                        <Rectangle x:Name="FocusRectangle"
                                   StrokeThickness="{TemplateBinding BorderThickness}"
                                   Opacity="0"
                                   Stroke="{StaticResource TextBoxMouseOverBorderBrush}" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   StrokeThickness="{TemplateBinding BorderThickness}"
                                   Opacity="0"
                                   Margin="1"
                                   Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}" />
                        <Grid Margin="0,1,0,0">
                            <Border x:Name="ReadOnlyVisualElement"
                                    Background="{StaticResource ReadOnlyBrush}"
                                    Opacity="0" />
                            <Grid>
                                <ScrollViewer x:Name="PART_ContentHost"
                                              BorderThickness="0"
                                              IsTabStop="False"
                                              Margin="4,0,4,2"
                                              VerticalAlignment="Center"
                                              Background="{x:Null}" />
                            </Grid>
                        </Grid>
                        <Rectangle x:Name="DisabledVisualElement"
                                   Stroke="{StaticResource ControlsDisabledBrush}"
                                   StrokeThickness="{TemplateBinding BorderThickness}"
                                   Fill="{StaticResource ControlsDisabledBrush}"
                                   IsHitTestVisible="False"
                                   Opacity="0" />
                        <Border x:Name="ValidationErrorElement"
                                BorderBrush="{StaticResource ControlsValidationBrush}"
                                BorderThickness="1"
                                Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip"
                                         IsHitTestVisible="True"
                                         DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Placement="Right"
                                         PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                         Template="{StaticResource ValidationToolTipTemplate}" />
                            </ToolTipService.ToolTip>
                            <Grid Background="Transparent"
                                  HorizontalAlignment="Right"
                                  Height="12"
                                  Margin="1,-4,-4,0"
                                  VerticalAlignment="Top"
                                  Width="12">
                                <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"
                                      Fill="{StaticResource ValidationBrush5}"
                                      Margin="1,3,0,0" />
                                <Path Data="M 0,0 L2,0 L 8,6 L8,8"
                                      Fill="{StaticResource WhiteColorBrush}"
                                      Margin="1,3,0,0" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--ProgressBar Style-->
    <Style TargetType="ProgressBar"
           x:Key="DefaultProgressBarStyle">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="Foreground"
                Value="{StaticResource HighlightBrush}" />
        <Setter Property="Background"
                Value="{StaticResource GrayBrush4}" />
        <Setter Property="Maximum"
                Value="100" />
        <Setter Property="Height"
                Value="10" />
        <Setter Property="IsTabStop"
                Value="False" />
        <Setter Property="BorderBrush"
                Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ProgressBar">
                    <Grid x:Name="Root">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Determinate" />
                                <vsm:VisualState x:Name="Indeterminate">
                                    <Storyboard RepeatBehavior="Forever">
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00"
                                                                       Storyboard.TargetProperty="(UIElement.Visibility)"
                                                                       Storyboard.TargetName="IndeterminateRoot">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00"
                                                                       Storyboard.TargetProperty="(UIElement.Visibility)"
                                                                       Storyboard.TargetName="DeterminateRoot">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="X"
                                                                       Storyboard.TargetName="IndeterminateGradientFillTransform">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value="0" />
                                            <SplineDoubleKeyFrame KeyTime="00:00:.35"
                                                                  Value="20" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border x:Name="PART_Track"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}" />
                        <Grid x:Name="ProgressBarRootGrid">
                            <Grid x:Name="IndeterminateRoot"
                                  Visibility="Collapsed">
                                <Rectangle x:Name="IndeterminateSolidFill"
                                           Margin="{TemplateBinding BorderThickness}"
                                           Opacity="1"
                                           RenderTransformOrigin="0.5,0.5"
                                           StrokeThickness="0"
                                           Fill="{StaticResource BrandingBrush}" />
                                <Rectangle x:Name="IndeterminateGradientFill"
                                           Margin="{TemplateBinding BorderThickness}"
                                           Opacity="0.7"
                                           StrokeThickness="1">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="0,1"
                                                             MappingMode="Absolute"
                                                             SpreadMethod="Repeat"
                                                             StartPoint="20,1">
                                            <LinearGradientBrush.Transform>
                                                <TransformGroup>
                                                    <TranslateTransform x:Name="IndeterminateGradientFillTransform"
                                                                        X="0" />
                                                    <SkewTransform AngleX="-30" />
                                                </TransformGroup>
                                            </LinearGradientBrush.Transform>
                                            <GradientStop Color="{StaticResource ProgressIndeterminateColor1}"
                                                          Offset="0" />
                                            <GradientStop Color="{StaticResource ProgressIndeterminateColor2}"
                                                          Offset="0.651" />
                                            <GradientStop Color="{StaticResource ProgressIndeterminateColor3}"
                                                          Offset="0.093" />
                                            <GradientStop Color="{StaticResource ProgressIndeterminateColor4}"
                                                          Offset="0.548" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Grid>
                            <Grid x:Name="DeterminateRoot"
                                  Margin="1">
                                <Border x:Name="PART_Indicator"
                                        Background="{StaticResource BrandingBrush}"
                                        HorizontalAlignment="Left"
                                        Margin="-1">
                                    <Rectangle x:Name="GradientFill"
                                               Opacity="0.7"
                                               Visibility="Collapsed">
                                        <Rectangle.Fill>
                                            <LinearGradientBrush EndPoint="0,1"
                                                                 MappingMode="Absolute"
                                                                 SpreadMethod="Repeat"
                                                                 StartPoint="20,1">
                                                <LinearGradientBrush.Transform>
                                                    <TransformGroup>
                                                        <TranslateTransform X="0" />
                                                        <SkewTransform AngleX="-30" />
                                                    </TransformGroup>
                                                </LinearGradientBrush.Transform>
                                                <GradientStop Color="{StaticResource ProgressIndeterminateColor1}"
                                                              Offset="0" />
                                                <GradientStop Color="{StaticResource ProgressIndeterminateColor2}"
                                                              Offset="0.651" />
                                                <GradientStop Color="{StaticResource ProgressIndeterminateColor3}"
                                                              Offset="0.093" />
                                                <GradientStop Color="{StaticResource ProgressIndeterminateColor4}"
                                                              Offset="0.548" />
                                            </LinearGradientBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                </Border>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderThickness"
                Value="1" />
    </Style>

    <!--RadioButton Style-->
    <Style TargetType="RadioButton"
           x:Key="DefaultRadioButtonStyle">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="FontFamily"
                Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize"
                Value="{StaticResource ContentFontSize}" />
        <Setter Property="Background"
                Value="{StaticResource CheckBoxBackgroundBrush}" />
        <Setter Property="Foreground"
                Value="{StaticResource TextBrush}" />
        <Setter Property="HorizontalContentAlignment"
                Value="Left" />
        <Setter Property="VerticalContentAlignment"
                Value="Top" />
        <Setter Property="Padding"
                Value="4,0,0,0" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="BorderBrush"
                Value="{StaticResource CheckBoxBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RadioButton">
                    <Grid>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="MouseOverEllipse">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenterWrapperColor"
                                                                      Storyboard.TargetProperty="Color">
                                            <EasingColorKeyFrame KeyTime="0"
                                                                 Value="{StaticResource Gray2}" />
                                        </ColorAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="grid">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard />
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="contentPresenter">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="DisabledVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value="0.55" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="CheckStates">
                                <vsm:VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="CheckIcon">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unchecked" />
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Focused">
                                    <Storyboard />
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unfocused" />
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="ValidationStates">
                                <vsm:VisualState x:Name="Valid" />
                                <vsm:VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen"
                                                                       Storyboard.TargetName="validationTooltip">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <sys:Boolean>True</sys:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="16" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid HorizontalAlignment="Left"
                              VerticalAlignment="Center">
                            <Grid x:Name="grid"
                                  Height="15"
                                  Width="15"
                                  Opacity="0.7">
                                <Ellipse x:Name="Background"
                                         Fill="{TemplateBinding Background}"
                                         Stroke="{TemplateBinding BorderBrush}"
                                         Margin="1"
                                         StrokeThickness="{TemplateBinding BorderThickness}" />
                                <Ellipse x:Name="MouseOverEllipse"
                                         Stroke="{StaticResource CheckBoxMouseOverBrush}"
                                         Margin="1"
                                         Opacity="0" />
                                <Ellipse x:Name="PressedEllipse"
                                         Stroke="{StaticResource BlackBrush}"
                                         Margin="1"
                                         Opacity="0" />
                                <Ellipse x:Name="CheckIcon"
                                         Fill="{StaticResource BlackBrush}"
                                         Height="7"
                                         Opacity="0"
                                         Width="7" />
                                <Ellipse x:Name="DisabledVisualElement"
                                         Fill="{StaticResource DisabledWhiteColorBrush}"
                                         Opacity="0" />
                                <Grid x:Name="ValidationErrorElement"
                                      ToolTipService.PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                      Visibility="Collapsed">
                                    <ToolTipService.ToolTip>
                                        <ToolTip x:Name="validationTooltip"
                                                 IsHitTestVisible="True"
                                                 DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                                 Placement="Right"
                                                 PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
                                                 Template="{StaticResource ValidationToolTipTemplate}" />
                                    </ToolTipService.ToolTip>
                                    <Ellipse Height="14"
                                             Stroke="{StaticResource ControlsValidationBrush}"
                                             StrokeThickness="1"
                                             Width="14" />
                                    <Ellipse Fill="{StaticResource ControlsValidationBrush}"
                                             HorizontalAlignment="Right"
                                             Height="4"
                                             Margin="0,-2,-1,0"
                                             VerticalAlignment="Top"
                                             Width="4" />
                                    <Ellipse Fill="Transparent"
                                             HorizontalAlignment="Right"
                                             Height="10"
                                             Margin="0,-5,-4,0"
                                             VerticalAlignment="Top"
                                             Width="10" />
                                </Grid>
                            </Grid>
                        </Grid>
                        <ContentControl Grid.Column="1"
                                        VerticalAlignment="Center">
                            <ContentControl.Foreground>
                                <SolidColorBrush x:Name="ContentPresenterWrapperColor"
                                                 Color="{StaticResource BlackColor}"
                                                 PresentationOptions:Freeze="True" />
                            </ContentControl.Foreground>
                            <ContentPresenter x:Name="contentPresenter"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              Content="{TemplateBinding Content}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              Margin="{TemplateBinding Padding}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              RenderOptions.ClearTypeHint="Enabled" />
                        </ContentControl>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--RepeatButton Style-->
    <Style TargetType="RepeatButton"
           x:Key="DefaultRepeatButtonStyle">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="Background"
                Value="{StaticResource GrayBrush7}" />
        <Setter Property="BorderBrush"
                Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Foreground"
                Value="{StaticResource TextBrush}" />
        <Setter Property="FontFamily"
                Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize"
                Value="{StaticResource ContentFontSize}" />
        <Setter Property="TextOptions.TextHintingMode"
                Value="Animated" />
        <Setter Property="FontWeight"
                Value="Bold" />
        <Setter Property="Padding"
                Value="5,6" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="RepeatButton">
                    <Grid>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="MouseOverBorder">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="PressedBorder">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="DisabledVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="contentPresenter">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="FocusRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="FocusInnerRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unfocused" />
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="3" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{StaticResource DisabledWhiteColorBrush}"
                                   IsHitTestVisible="false"
                                   Opacity="0"
                                   RadiusY="3"
                                   RadiusX="3" />
                        <Border x:Name="MouseOverBorder"
                                Background="{StaticResource GrayBrush8}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Border x:Name="PressedBorder"
                                Background="{StaticResource GrayBrush5}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Rectangle x:Name="FocusRectangle"
                                   Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}"
                                   RadiusY="4"
                                   RadiusX="4"
                                   Margin="-1"
                                   Opacity="0" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   StrokeThickness="{TemplateBinding BorderThickness}"
                                   Stroke="{StaticResource TextBoxMouseOverBorderBrush}"
                                   RadiusX="3"
                                   RadiusY="3"
                                   Opacity="0" />
                        <ContentPresenter x:Name="contentPresenter"
                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                          Content="{TemplateBinding Content}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          Margin="{TemplateBinding Padding}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Thumb Style-->
    <Style x:Key="HorizontalSliderThumb"
           TargetType="Thumb">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="Background"
                Value="{StaticResource GrayBrush7}" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="IsTabStop"
                Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Thumb">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard />
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="DisabledVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border Background="{StaticResource BlackBrush}"
                                BorderThickness="0,0,1,0"
                                BorderBrush="{StaticResource ControlBackgroundBrush}" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{StaticResource DisabledWhiteColorBrush}"
                                   IsHitTestVisible="false"
                                   Opacity="0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--HorizontalTrackLargeDecrease-->
    <ControlTemplate x:Key="HorizontalTrackLargeDecrease"
                     TargetType="RepeatButton">
        <Grid x:Name="Root"
              Margin="0,-1,0,0">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver" />
                    <VisualState x:Name="Pressed" />
                    <VisualState x:Name="Disabled" />
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle Height="3"
                       Margin="0,1,0,0">
                <Rectangle.Fill>
                    <SolidColorBrush Color="{StaticResource BlackColor}"
                                     PresentationOptions:Freeze="True" />
                </Rectangle.Fill>
            </Rectangle>
        </Grid>
    </ControlTemplate>

    <!--Slider Style-->
    <Style TargetType="Slider"
           x:Key="DefaultSliderStyle">
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="Maximum"
                Value="10" />
        <Setter Property="Minimum"
                Value="0" />
        <Setter Property="Value"
                Value="0" />
        <Setter Property="BorderBrush"
                Value="{StaticResource ControlBorderBrush}" />
        <Setter Property="IsTabStop"
                Value="False" />
        <Setter Property="Foreground"
                Value="{StaticResource TextBrush}" />
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="OverridesDefaultStyle"
                Value="true" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Slider">
                    <Grid x:Name="Root">
                        <Grid.LayoutTransform>
                            <RotateTransform Angle="0" />
                        </Grid.LayoutTransform>
                        <Grid.Resources>
                            <ControlTemplate x:Key="RepeatButtonTemplate">
                                <Grid x:Name="Root"
                                      Opacity="0" />
                            </ControlTemplate>
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="HorizontalTrackRectangleDisabledOverlay">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="ThumbDisabledOverlay">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                                       Storyboard.TargetProperty="Visibility"
                                                                       Storyboard.TargetName="VerticalTrackRectangleDisabledOverlay">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                                       Storyboard.TargetName="ThumbDisabledOverlayVertical">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                                       Storyboard.TargetName="HorizontalTrackRectangleDisabledOverlay_Copy">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                                       Storyboard.TargetName="VerticalTrackRectangleDisabledOverlay_Copy">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="Focused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="HorizontalTemplate"
                              Background="{TemplateBinding Background}">
                            <Rectangle x:Name="TrackRectangle"
                                       Height="3"
                                       Margin="5,0"
                                       StrokeThickness="{TemplateBinding BorderThickness}"
                                       Fill="{StaticResource SliderTrackBrush}" />
                            <Rectangle x:Name="HorizontalTrackRectangleDisabledOverlay"
                                       Fill="{StaticResource DisabledWhiteColorBrush}"
                                       Height="3"
                                       Margin="5,0,5,0"
                                       Opacity=".55"
                                       Visibility="Collapsed" />
                            <Rectangle x:Name="HorizontalTrackRectangleDisabledOverlay_Copy"
                                       Fill="{StaticResource DisabledWhiteColorBrush}"
                                       Height="4"
                                       Opacity="0.7"
                                       Visibility="Collapsed" />
                            <Track x:Name="PART_Track"
                                   Margin="5,0"
                                   Orientation="Horizontal">
                                <Track.DecreaseRepeatButton>
                                    <RepeatButton x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton"
                                                  Height="10"
                                                  IsTabStop="False"
                                                  Template="{StaticResource HorizontalTrackLargeDecrease}" />
                                </Track.DecreaseRepeatButton>
                                <Track.Thumb>
                                    <Thumb x:Name="HorizontalThumb"
                                           Height="10"
                                           IsTabStop="True"
                                           Width="4"
                                           Style="{StaticResource HorizontalSliderThumb}" />
                                </Track.Thumb>
                                <Track.IncreaseRepeatButton>
                                    <RepeatButton x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton"
                                                  Height="10"
                                                  IsTabStop="False"
                                                  Template="{StaticResource RepeatButtonTemplate}" />
                                </Track.IncreaseRepeatButton>
                            </Track>
                            <Rectangle x:Name="ThumbDisabledOverlay"
                                       Grid.Column="1"
                                       Fill="{StaticResource DisabledWhiteColorBrush}"
                                       Opacity="0.25"
                                       Visibility="Collapsed"
                                       Width="4"
                                       Height="10" />
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Orientation"
                                 Value="Vertical">
                            <Setter Property="LayoutTransform"
                                    TargetName="Root">
                                <Setter.Value>
                                    <RotateTransform Angle="-90" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--ToggleButton Style-->
    <Style TargetType="ToggleButton"
           x:Key="DefaultToggleButtonStyle">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="Background"
                Value="{StaticResource GrayBrush7}" />
        <Setter Property="BorderBrush"
                Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Foreground"
                Value="{StaticResource TextBrush}" />
        <Setter Property="FontFamily"
                Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize"
                Value="{StaticResource ContentFontSize}" />
        <Setter Property="FontWeight"
                Value="Bold" />
        <Setter Property="Padding"
                Value="5,6" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="MouseOverBorder">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="PressedBorder">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="DisabledVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value=".55" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="contentPresenter">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="CheckStates">
                                <vsm:VisualState x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="CheckedRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="CheckedInnerRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unchecked" />
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="FocusRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="FocusInnerRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unfocused" />
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="3" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="{StaticResource WhiteColorBrush}"
                                   IsHitTestVisible="false"
                                   Opacity="0"
                                   RadiusY="3"
                                   RadiusX="3" />
                        <Border x:Name="MouseOverBorder"
                                Background="{StaticResource GrayBrush8}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Border x:Name="PressedBorder"
                                Background="{StaticResource GrayBrush5}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Border x:Name="CheckedBorder"
                                Background="{StaticResource GrayBrush5}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0" />
                        <Rectangle x:Name="FocusRectangle"
                                   Stroke="{StaticResource TextBoxMouseOverInnerBorderBrush}"
                                   RadiusY="4"
                                   RadiusX="4"
                                   Margin="-1"
                                   Opacity="0" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   StrokeThickness="{TemplateBinding BorderThickness}"
                                   Stroke="{StaticResource TextBoxMouseOverBorderBrush}"
                                   RadiusX="3"
                                   RadiusY="3"
                                   Opacity="0" />
                        <Rectangle x:Name="CheckedRectangle"
                                   Stroke="{StaticResource GrayBrush1}"
                                   RadiusY="4"
                                   RadiusX="4"
                                   Margin="-1"
                                   Opacity="0" />
                        <Rectangle x:Name="CheckedInnerRectangle"
                                   Fill="{StaticResource GrayBrush2}"
                                   StrokeThickness="{TemplateBinding BorderThickness}"
                                   Stroke="{StaticResource GrayBrush2}"
                                   RadiusX="3"
                                   RadiusY="3"
                                   Opacity="0" />
                        <ContentPresenter x:Name="contentPresenter"
                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                          Content="{TemplateBinding Content}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          Margin="{TemplateBinding Padding}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          RenderOptions.ClearTypeHint="Enabled" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Tooltip Style-->
    <Style TargetType="ToolTip"
           x:Key="DefaultToolTipStyle">
        <Setter Property="SnapsToDevicePixels"
                Value="true" />
        <Setter Property="FontSize"
                Value="{StaticResource ControlContentFontSize}" />
        <Setter Property="FontWeight"
                Value="Bold" />
        <Setter Property="Background"
                Value="{StaticResource WhiteBrush}" />
        <Setter Property="Padding"
                Value="1" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="BorderBrush"
                Value="{StaticResource ItemSelectedBrush}" />
        <Setter Property="VerticalContentAlignment"
                Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToolTip">
                    <Border x:Name="Root"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Background="{TemplateBinding Background}"
                            Effect="{StaticResource DropShadowBrush}"
                            Opacity="0">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="OpenStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition From="Open"
                                                          GeneratedDuration="0:0:0.3"
                                                          To="Closed" />
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="Closed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Root">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.4"
                                                                  Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Open">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="Root">
                                            <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border Padding="{TemplateBinding Padding}">
                            <Border.Resources>
                                <Storyboard x:Key="Visible State" />
                                <Storyboard x:Key="Normal State" />
                            </Border.Resources>
                            <ContentPresenter Cursor="{TemplateBinding Cursor}"
                                              Content="{TemplateBinding Content}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              Margin="{TemplateBinding Padding}"
                                              Opacity="0.7"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                              RenderOptions.ClearTypeHint="Enabled" />
                        </Border>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Implicit Styles -->
    <!-- When defining your own styles, set "based on" the same way to keep control theming -->
    <Style TargetType="Button"
           BasedOn="{StaticResource DefaultButtonStyle}" />
    <!--<Style TargetType="Button" BasedOn="{StaticResource DefaultHyperlinkButtonStyle}" />-->
    <Style TargetType="TextBox"
           BasedOn="{StaticResource DefaultTextBoxStyle}" />
    <Style TargetType="ComboBox"
           BasedOn="{StaticResource DefaultComboBoxStyle}" />
    <Style TargetType="ComboBoxItem"
           BasedOn="{StaticResource DefaultComboBoxItemStyle}" />
    <Style TargetType="TextBlock"
           BasedOn="{StaticResource DefaultTextBlockStyle}" />
    <Style TargetType="ScrollBar"
           BasedOn="{StaticResource DefaultScrollBarStyle}" />
    <Style TargetType="ScrollViewer"
           BasedOn="{StaticResource DefaultScrollViewerStyle}" />
    <Style TargetType="ListBox"
           BasedOn="{StaticResource DefaultListBoxStyle}" />
    <Style TargetType="ListBoxItem"
           BasedOn="{StaticResource DefaultListBoxItemStyle}" />
    <Style TargetType="CheckBox"
           BasedOn="{StaticResource DefaultCheckBoxStyle}" />
    <Style TargetType="PasswordBox"
           BasedOn="{StaticResource DefaultPasswordBoxStyle}" />
    <Style TargetType="ProgressBar"
           BasedOn="{StaticResource DefaultProgressBarStyle}" />
    <Style TargetType="RadioButton"
           BasedOn="{StaticResource DefaultRadioButtonStyle}" />
    <Style TargetType="RepeatButton"
           BasedOn="{StaticResource DefaultRepeatButtonStyle}" />
    <Style TargetType="Slider"
           BasedOn="{StaticResource DefaultSliderStyle}" />
    <Style TargetType="ToggleButton"
           BasedOn="{StaticResource DefaultToggleButtonStyle}" />
    <Style TargetType="ToolTip"
           BasedOn="{StaticResource DefaultToolTipStyle}" />

</ResourceDictionary>
